from enum import Enum

class StatusCodeEnum(Enum):
    
    OK = (0,"成功")
    ERROR = (-1,"错误")
    WARNING = (-2,"警告")
    SERVER_ERR = (500,"服务器异常")
    NO_LOGIN_ERR = (4000, "用户未登录")
    PUBLIC_ADDRESS_ERR = (4001,"用户信息异常")
    VERIFY_CODE_ERROR = (4002,"验证码发送失败")
    LOGIN_ERR = (4003,"登录失败")
    PARAM_ERR = (4004,"参数异常")
    WAIT_PAY = (4006,"等待支付")
    
    DB_ERR = (5000,"数据库错误")
    
    @property
    def code(self):
        return self.value[0]

    @property
    def errmsg(self):
        return self.value[1]
    
    